﻿var opensocial=function(){};opensocial.requestSendMessage=function(A,C,B){opensocial.Container.get().requestSendMessage(A,C,B)};opensocial.requestShareApp=function(A,C,B){opensocial.Container.get().requestShareApp(A,C,B)};opensocial.requestCreateActivity=function(C,B,A){opensocial.Container.get().requestCreateActivity(C,B,A)};opensocial.CreateActivityPriority={HIGH:"HIGH",LOW:"LOW"};opensocial.hasPermission=function(A){return opensocial.Container.get().hasPermission(A)};opensocial.requestPermission=function(B,C,A){opensocial.Container.get().requestPermission(B,C,A)};opensocial.Permission={VIEWER:"viewer"};opensocial.getEnvironment=function(){return opensocial.Container.get().getEnvironment()};opensocial.newDataRequest=function(){return opensocial.Container.get().newDataRequest()};opensocial.newActivity=function(A){return opensocial.Container.get().newActivity(A)};opensocial.newActivityMediaItem=function(C,A,B){return opensocial.Container.get().newActivityMediaItem(C,A,B)};opensocial.newMessage=function(A,B){return opensocial.Container.get().newMessage(A,B)};Function.prototype.inherits=function(A){function B(){}B.prototype=A.prototype;this.superClass_=A.prototype;this.prototype=new B();this.prototype.constructor=this};opensocial.Container=function(){};opensocial.Container.container_=null;opensocial.Container.setContainer=function(A){opensocial.Container.container_=A};opensocial.Container.get=function(){return opensocial.Container.container_};opensocial.Container.prototype.getEnvironment=function(){};opensocial.Container.prototype.requestSendMessage=function(A,C,B){if(B){B(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.NOT_IMPLEMENTED,null))}};opensocial.Container.prototype.requestShareApp=function(A,C,B){if(B){B(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.NOT_IMPLEMENTED,null))}};opensocial.Container.prototype.requestCreateActivity=function(C,B,A){if(A){A(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.NOT_IMPLEMENTED,null))}};opensocial.Container.prototype.hasPermission=function(A){return false};opensocial.Container.prototype.requestPermission=function(B,C,A){if(A){A(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.NOT_IMPLEMENTED,null))}};opensocial.Container.prototype.requestData=function(A,B){};opensocial.Container.prototype.newFetchPersonRequest=function(B,A){};opensocial.Container.prototype.newFetchPeopleRequest=function(A,B){};opensocial.Container.prototype.newFetchPersonAppDataRequest=function(A,B){};opensocial.Container.prototype.newUpdatePersonAppDataRequest=function(C,A,B){};opensocial.Container.prototype.newFetchActivitiesRequest=function(A,B){};opensocial.Container.prototype.newCollection=function(C,B,A){return new opensocial.Collection(C,B,A)};opensocial.Container.prototype.newPerson=function(A,B,C){return new opensocial.Person(A,B,C)};opensocial.Container.prototype.newActivity=function(A){return new opensocial.Activity(A)};opensocial.Container.prototype.newActivityMediaItem=function(C,A,B){return new opensocial.Activity.MediaItem(C,A,B)};opensocial.Container.prototype.newMessage=function(A,B){return new opensocial.Message(A,B)};opensocial.Container.prototype.newResponseItem=function(A,C,B,D){return new opensocial.ResponseItem(A,C,B,D)};opensocial.Container.prototype.newDataResponse=function(A,B){return new opensocial.DataResponse(A,B)};opensocial.Container.prototype.newDataRequest=function(){return new opensocial.DataRequest()};opensocial.Container.prototype.newEnvironment=function(B,A){return new opensocial.Environment(B,A)};opensocial.Container.isArray=function(A){return A instanceof Array};var caja;var ___;var html_sanitize;opensocial.Container.prototype.enableCaja=function(){___=window.___;caja=window.caja;html_sanitize=window.html_sanitize;var D=caja.copy(___.sharedOuters);var B=window._IG_RegisterOnloadHandler;if(B){D._IG_RegisterOnloadHandler=___.simpleFunc(B)}D.emitHtml___=function C(F){var E=Array.prototype.slice.call(arguments,0).join("");document.write(E)};D.document=function(){};D.document.getElementById=function(F){var E=document.getElementById("DOM-PREFIX-"+F);if(E!==null){___.useSetHandler(E,"innerHTML",function(H){var G=html_sanitize(H,null,function(K){var J=K.split(/\s+/g);for(var I=0;I<J.length;++I){if(J[I]){J[I]="DOM-PREFIX-"+J[I]}}return J.join(" ")});return this.innerHTML=G})}return E};___.allowCall(D.document,"getElementById");D.gadgets=gadgets;D.opensocial=opensocial;___.allowCall(D.opensocial,"requestSendMessage");___.allowCall(D.opensocial,"requestShareApp");___.allowCall(D.opensocial,"requestCreateActivity");___.allowCall(D.opensocial,"hasPermission");___.allowCall(D.opensocial,"requestPermission");___.allowCall(D.opensocial,"getEnvironment");___.allowCall(D.opensocial,"newDataRequest");___.allowCall(D.opensocial,"newActivity");___.allowCall(D.opensocial,"newActivityMediaItem");___.allowCall(D.opensocial,"newMessage");___.allowCall(opensocial.Collection.prototype,"getById");___.allowCall(opensocial.Collection.prototype,"size");___.allowCall(opensocial.Collection.prototype,"each");___.allowCall(opensocial.Collection.prototype,"asArray");___.allowCall(opensocial.Collection.prototype,"getTotalSize");___.allowCall(opensocial.Collection.prototype,"getOffset");___.allowCall(Array.prototype,"push");___.allowCall(Array.prototype,"sort");___.allowCall(opensocial.Person.prototype,"getId");___.allowCall(opensocial.Person.prototype,"getDisplayName");___.allowCall(opensocial.Person.prototype,"getField");___.allowCall(opensocial.Person.prototype,"isViewer");___.allowCall(opensocial.Person.prototype,"isOwner");___.allowCall(opensocial.Address.prototype,"getField");___.allowCall(opensocial.BodyType.prototype,"getField");___.allowCall(opensocial.Email.prototype,"getField");___.allowCall(opensocial.Name.prototype,"getField");___.allowCall(opensocial.Organization.prototype,"getField");___.allowCall(opensocial.Phone.prototype,"getField");___.allowCall(opensocial.Url.prototype,"getField");___.allowCall(opensocial.Activity.prototype,"getId");___.allowCall(opensocial.Activity.prototype,"getField");___.allowCall(opensocial.Activity.MediaItem.prototype,"getField");___.allowCall(opensocial.ResponseItem.prototype,"hadError");___.allowCall(opensocial.ResponseItem.prototype,"getError");___.allowCall(opensocial.ResponseItem.prototype,"getOriginalDataRequest");___.allowCall(opensocial.ResponseItem.prototype,"getData");___.allowCall(opensocial.DataResponse.prototype,"hadError");___.allowCall(opensocial.DataResponse.prototype,"get");___.allowCall(opensocial.DataRequest.prototype,"getRequestObjects");___.allowCall(opensocial.DataRequest.prototype,"add");___.allowCall(opensocial.DataRequest.prototype,"send");___.allowCall(opensocial.DataRequest.prototype,"newFetchPersonRequest");___.allowCall(opensocial.DataRequest.prototype,"newFetchPeopleRequest");___.allowCall(opensocial.DataRequest.prototype,"newFetchPersonAppDataRequest");___.allowCall(opensocial.DataRequest.prototype,"newUpdatePersonAppDataRequest");___.allowCall(opensocial.DataRequest.prototype,"newFetchActivitiesRequest");___.allowCall(opensocial.Environment.prototype,"getDomain");___.allowCall(opensocial.Environment.prototype,"supportsField");___.allowCall(opensocial.Enum.prototype,"getKey");___.allowCall(opensocial.Enum.prototype,"getDisplayValue");___.allowCall(opensocial.Message.prototype,"getField");___.allowCall(opensocial.Message.prototype,"setField");var A=___.freeze({getOuters:___.simpleFunc(function(){return D}),handle:___.simpleFunc(function(E){E(D)})});___.setNewModuleHandler(A)};function plugin_tamed(A){return A}function plugin_dispatchEvent___(C,D,A,B){return ___.getOuters(A)[B](plugin_tamed(C),plugin_tamed(D))}opensocial.Activity=function(A){this.fields_=A};opensocial.Activity.Field={TITLE_ID:"titleId",TITLE:"title",TEMPLATE_PARAMS:"templateParams",URL:"url",MEDIA_ITEMS:"mediaItems",BODY_ID:"bodyId",BODY:"body",EXTERNAL_ID:"externalId",STREAM_TITLE:"streamTitle",STREAM_URL:"streamUrl",STREAM_SOURCE_URL:"streamSourceUrl",STREAM_FAVICON_URL:"streamFaviconUrl",PRIORITY:"priority",ID:"id",USER_ID:"userId",APP_ID:"appId",POSTED_TIME:"postedTime"};opensocial.Activity.prototype.getId=function(){return this.getField(opensocial.Activity.Field.ID)};opensocial.Activity.prototype.getField=function(A){return this.fields_[A]};opensocial.Activity.prototype.setField=function(A,B){return this.fields_[A]=B};opensocial.Activity.MediaItem=function(C,A,B){this.fields_=B||{};this.fields_[opensocial.Activity.MediaItem.Field.MIME_TYPE]=C;this.fields_[opensocial.Activity.MediaItem.Field.URL]=A};opensocial.Activity.MediaItem.Type={IMAGE:"image",VIDEO:"video",AUDIO:"audio"};opensocial.Activity.MediaItem.Field={TYPE:"type",MIME_TYPE:"mimeType",URL:"url"};opensocial.Activity.MediaItem.prototype.getField=function(A){return this.fields_[A]};opensocial.Activity.MediaItem.prototype.setField=function(A,B){return this.fields_[A]=B};opensocial.Address=function(A){this.fields_=A||{}};opensocial.Address.Field={TYPE:"type",UNSTRUCTURED_ADDRESS:"unstructuredAddress",PO_BOX:"poBox",STREET_ADDRESS:"streetAddress",EXTENDED_ADDRESS:"extendedAddress",REGION:"region",LOCALITY:"locality",POSTAL_CODE:"postalCode",COUNTRY:"country",LATITUDE:"latitude",LONGITUDE:"longitude"};opensocial.Address.prototype.getField=function(A){return this.fields_[A]};opensocial.BodyType=function(A){this.fields_=A||{}};opensocial.BodyType.Field={BUILD:"build",HEIGHT:"height",WEIGHT:"weight",EYE_COLOR:"eyeColor",HAIR_COLOR:"hairColor"};opensocial.BodyType.prototype.getField=function(A){return this.fields_[A]};opensocial.Collection=function(C,B,A){this.array_=C||[];this.offset_=B||0;this.totalSize_=A||this.array_.length};opensocial.Collection.prototype.getById=function(C){for(var A=0;A<this.size();A++){var B=this.array_[A];if(B.getId()==C){return B}}return null};opensocial.Collection.prototype.size=function(){return this.array_.length};opensocial.Collection.prototype.each=function(B){for(var A=0;A<this.size();A++){B(this.array_[A])}};opensocial.Collection.prototype.asArray=function(){return this.array_};opensocial.Collection.prototype.getTotalSize=function(){return this.totalSize_};opensocial.Collection.prototype.getOffset=function(){return this.offset_};opensocial.DataRequest=function(){this.requestObjects_=[]};opensocial.DataRequest.prototype.requestObjects_=null;opensocial.DataRequest.prototype.getRequestObjects=function(){return this.requestObjects_};opensocial.DataRequest.prototype.add=function(B,A){return this.requestObjects_.push({key:A,request:B})};opensocial.DataRequest.prototype.send=function(A){var B=A||function(){};opensocial.Container.get().requestData(this,B)};opensocial.DataRequest.PersonId={OWNER:"OWNER",VIEWER:"VIEWER"};opensocial.DataRequest.Group={OWNER_FRIENDS:"OWNER_FRIENDS",VIEWER_FRIENDS:"VIEWER_FRIENDS"};opensocial.DataRequest.SortOrder={TOP_FRIENDS:"topFriends",NAME:"name"};opensocial.DataRequest.FilterType={ALL:"all",HAS_APP:"hasApp"};opensocial.DataRequest.PeopleRequestFields={PROFILE_DETAILS:"profileDetail",SORT_ORDER:"sortOrder",FILTER:"filter",FIRST:"first",MAX:"max"};opensocial.DataRequest.prototype.addDefaultParam=function(C,B,A){C[B]=C[B]||A};opensocial.DataRequest.prototype.addDefaultProfileFields=function(B){var A=opensocial.DataRequest.PeopleRequestFields;var C=B[A.PROFILE_DETAILS]||[];B[A.PROFILE_DETAILS]=C.concat([opensocial.Person.Field.ID,opensocial.Person.Field.NAME,opensocial.Person.Field.THUMBNAIL_URL])};opensocial.DataRequest.prototype.asArray=function(A){if(opensocial.Container.isArray(A)){return A}else{return[A]}};opensocial.DataRequest.prototype.newFetchPersonRequest=function(C,B){B=B||{};var A=opensocial.DataRequest.PeopleRequestFields;this.addDefaultProfileFields(B);return opensocial.Container.get().newFetchPersonRequest(C,B)};opensocial.DataRequest.prototype.newFetchPeopleRequest=function(B,C){C=C||{};var A=opensocial.DataRequest.PeopleRequestFields;this.addDefaultProfileFields(C);this.addDefaultParam(C,A.SORT_ORDER,opensocial.DataRequest.SortOrder.TOP_FRIENDS);this.addDefaultParam(C,A.FILTER,opensocial.DataRequest.FilterType.ALL);this.addDefaultParam(C,A.FIRST,0);this.addDefaultParam(C,A.MAX,20);return opensocial.Container.get().newFetchPeopleRequest(B,C)};opensocial.DataRequest.prototype.newFetchPersonAppDataRequest=function(A,B){return opensocial.Container.get().newFetchPersonAppDataRequest(A,this.asArray(B))};opensocial.DataRequest.prototype.newUpdatePersonAppDataRequest=function(C,A,B){return opensocial.Container.get().newUpdatePersonAppDataRequest(C,A,B)};opensocial.DataRequest.ActivityRequestFields={APP_ID:"appId"};opensocial.DataRequest.prototype.newFetchActivitiesRequest=function(A,B){B=B||{};return opensocial.Container.get().newFetchActivitiesRequest(A,B)};opensocial.DataResponse=function(A,B){this.responseItems_=A;this.globalError_=B};opensocial.DataResponse.prototype.hadError=function(){return !!this.globalError_};opensocial.DataResponse.prototype.get=function(A){return this.responseItems_[A]};opensocial.Email=function(A){this.fields_=A||{}};opensocial.Email.Field={TYPE:"type",ADDRESS:"address"};opensocial.Email.prototype.getField=function(A){return this.fields_[A]};opensocial.Enum=function(B,A){this.key=B;this.displayValue=A};opensocial.Enum.prototype.getKey=function(){return this.key};opensocial.Enum.prototype.getDisplayValue=function(){return this.displayValue};opensocial.Enum.Smoker={NO:"NO",YES:"YES",SOCIALLY:"SOCIALLY",OCCASIONALLY:"OCCASIONALLY",REGULARLY:"REGULARLY",HEAVILY:"HEAVILY",QUITTING:"QUITTING",QUIT:"QUIT"};opensocial.Enum.Drinker={NO:"NO",YES:"YES",SOCIALLY:"SOCIALLY",OCCASIONALLY:"OCCASIONALLY",REGULARLY:"REGULARLY",HEAVILY:"HEAVILY",QUITTING:"QUITTING",QUIT:"QUIT"};opensocial.Enum.Gender={MALE:"MALE",FEMALE:"FEMALE"};opensocial.Environment=function(B,A){this.domain=B;this.supportedFields=A};opensocial.Environment.prototype.getDomain=function(){return this.domain};opensocial.Environment.ObjectType={PERSON:"person",ADDRESS:"address",BODY_TYPE:"bodyType",EMAIL:"email",NAME:"name",ORGANIZATION:"organization",PHONE:"phone",URL:"url",ACTIVITY:"activity",ACTIVITY_MEDIA_ITEM:"activityMediaItem",MESSAGE:"message",MESSAGE_TYPE:"messageType",SORT_ORDER:"sortOrder",FILTER_TYPE:"filterType"};opensocial.Environment.prototype.supportsField=function(A,C){var B=this.supportedFields[A]||[];return !!B[C]};opensocial.Message=function(A,B){this.fields_=B||{};this.fields_[opensocial.Message.Field.BODY]=A};opensocial.Message.Field={TYPE:"type",TITLE:"title",BODY:"body"};opensocial.Message.Type={EMAIL:"email",NOTIFICATION:"notification",PRIVATE_MESSAGE:"privateMessage",PUBLIC_MESSAGE:"publicMessage"};opensocial.Message.prototype.getField=function(A){return this.fields_[A]};opensocial.Message.prototype.setField=function(A,B){return this.fields_[A]=B};opensocial.Name=function(A){this.fields_=A||{}};opensocial.Name.Field={FAMILY_NAME:"familyName",GIVEN_NAME:"givenName",ADDITIONAL_NAME:"additionalName",HONORIFIC_PREFIX:"honorificPrefix",HONORIFIC_SUFFIX:"honorificSuffix",UNSTRUCTURED:"unstructured"};opensocial.Name.prototype.getField=function(A){return this.fields_[A]};opensocial.Organization=function(A){this.fields_=A||{}};opensocial.Organization.Field={NAME:"name",TITLE:"title",DESCRIPTION:"description",FIELD:"field",SUB_FIELD:"subField",START_DATE:"startDate",END_DATE:"endDate",SALARY:"salary",ADDRESS:"address",WEBPAGE:"webpage"};opensocial.Organization.prototype.getField=function(A){return this.fields_[A]};opensocial.Person=function(A,B,C){this.fields_=A||{};this.isOwner_=B;this.isViewer_=C};opensocial.Person.Field={ID:"id",NAME:"name",NICKNAME:"nickname",THUMBNAIL_URL:"thumbnailUrl",PROFILE_URL:"profileUrl",CURRENT_LOCATION:"currentLocation",ADDRESSES:"addresses",EMAILS:"emails",PHONE_NUMBERS:"phoneNumbers",ABOUT_ME:"aboutMe",STATUS:"status",PROFILE_SONG:"profileSong",PROFILE_VIDEO:"profileVideo",GENDER:"gender",SEXUAL_ORIENTATION:"sexualOrientation",RELATIONSHIP_STATUS:"relationshipStatus",AGE:"age",DATE_OF_BIRTH:"dateOfBirth",BODY_TYPE:"bodyType",ETHNICITY:"ethnicity",SMOKER:"smoker",DRINKER:"drinker",CHILDREN:"children",PETS:"pets",LIVING_ARRANGEMENT:"livingArrangement",TIME_ZONE:"timeZone",LANGUAGES_SPOKEN:"languagesSpoken",JOBS:"jobs",JOB_INTERESTS:"jobInterests",SCHOOLS:"schools",INTERESTS:"interests",URLS:"urls",MUSIC:"music",MOVIES:"movies",TV_SHOWS:"tvShows",BOOKS:"books",ACTIVITIES:"activities",SPORTS:"sports",HEROES:"heroes",QUOTES:"quotes",CARS:"cars",FOOD:"food",TURN_ONS:"turnOns",TURN_OFFS:"turnOffs",TAGS:"tags",ROMANCE:"romance",SCARED_OF:"scaredOf",HAPPIEST_WHEN:"happiestWhen",FASHION:"fashion",HUMOR:"humor",LOOKING_FOR:"lookingFor",RELIGION:"religion",POLITICAL_VIEWS:"politicalViews"};opensocial.Person.prototype.getId=function(){return this.getField(opensocial.Person.Field.ID)};var ORDERED_NAME_FIELDS_=[opensocial.Name.Field.HONORIFIC_PREFIX,opensocial.Name.Field.GIVEN_NAME,opensocial.Name.Field.FAMILY_NAME,opensocial.Name.Field.HONORIFIC_SUFFIX,opensocial.Name.Field.ADDITIONAL_NAME];opensocial.Person.prototype.getDisplayName=function(){var B=this.getField(opensocial.Person.Field.NAME);if(B){var E=B.getField(opensocial.Name.Field.UNSTRUCTURED);if(E){return E}var D="";for(var C=0;C<ORDERED_NAME_FIELDS_.length;C++){var A=B.getField(ORDERED_NAME_FIELDS_[C]);if(A){D+=A+" "}}return D.replace(/^\s+|\s+$/g,"")}return this.getField(opensocial.Person.Field.NICKNAME)};opensocial.Person.prototype.getField=function(A){return this.fields_[A]};opensocial.Person.prototype.isViewer=function(){return !!this.isViewer_};opensocial.Person.prototype.isOwner=function(){return !!this.isOwner_};opensocial.Phone=function(A){this.fields_=A||{}};opensocial.Phone.Field={TYPE:"type",NUMBER:"number"};opensocial.Phone.prototype.getField=function(A){return this.fields_[A]};opensocial.ResponseItem=function(A,C,B,D){this.originalDataRequest_=A;this.data_=C;this.errorCode_=B;this.errorMessage_=D};opensocial.ResponseItem.prototype.hadError=function(){return !!this.errorCode_};opensocial.ResponseItem.Error={NOT_IMPLEMENTED:"notImplemented",UNAUTHORIZED:"unauthorized",FORBIDDEN:"forbidden",BAD_REQUEST:"badRequest",INTERNAL_ERROR:"internalError"};opensocial.ResponseItem.prototype.getErrorCode=function(){return this.errorCode_};opensocial.ResponseItem.prototype.getErrorMessage=function(){return this.errorMessage_};opensocial.ResponseItem.prototype.getOriginalDataRequest=function(){return this.originalDataRequest_};opensocial.ResponseItem.prototype.getData=function(){return this.data_};opensocial.Url=function(A){this.fields_=A||{}};opensocial.Url.Field={TYPE:"type",LINK_TEXT:"linkText",ADDRESS:"address"};opensocial.Url.prototype.getField=function(A){return this.fields_[A]};