/* Svidget.js v0.3.5 on 2018-03-02, Copyright 2018 Joe Agster http://www.svidget.org MIT License */ !function(a,b){"function"==typeof define&&define.amd?define(["svidget"],b):"object"==typeof module&&module.exports?module.exports=b:a.svidget=b(a)}(this,function(a,b){var c={},d=a,e=d.document||{};c.root=null,c.global=a,c.version="0.3.5",c.declaredHandlerName="_declared",c.emptyArray=[],c.defaultType="object",c.array=function(a){if(!a||!a.length)return null;try{return c.emptyArray.slice.call(a,0)}catch(c){for(var b=[],d=0;d2?b:null,d=f>3?d:null,!!e&&this.addHandler(a,e,d,b)},off:function(a,b){var d=c.isFunction(b)?b:null,e=null!=d?null:b;return this.removeHandler(a,d,e)},trigger:function(a,b,d){if(null!=a){var e=this.triggerHandlers(a,b,d);c.log("trigger: "+a),e.isPropagationStopped()||this.bubble(a,e)}},triggerHandlers:function(a,b,d){var e=new c.Event(null,a,null,this.getTarget(),d,b);return null==a||null==this.handlers||null==this.handlers[a]?e:(this.handlers[a].each(function(a){if(e.isImmediatePropagationStopped())return!1;null!=a&&null!=a.handler&&"function"==typeof a.handler&&(e.name=a.name,e.data=a.data,a.handler.call(null,e))}),e)},bubble:function(a,b){this.ensureBubbleParents(),b.name=null,b.data=null,this.bubbleParents[a]&&this.bubbleParents[a](a,b,this.getTarget())},addHandler:function(a,b,c,d){if(this.ensureHandlersByType(a),this.handlerExists(a,b,c))return!1;var e=this.toHandlerObject(b,c,d);return this.handlers[a].push(e),!0},removeHandler:function(a,b,c){if(this.ensureHandlers(),!this.handlers[a])return!1;var d=this;return this.handlers[a].removeWhere(function(a){return d.handlerMatch(a,b,c)})},handlerExists:function(a,b,c){var d=this;return this.handlers[a].any(function(a){return d.handlerMatch(a,b,c)})},handlerMatch:function(a,b,c){return null!=c&&a.name===c||b===a.handler},setBubbleParent:function(a,b){this.ensureBubbleParents(),this.bubbleParents[a]=b},registerBubbleCallback:function(a,b,d){if(b&&d)for(var e=0;e0;for(var b=0;b=0},each:function(a){for(var b=0;b=0;b--)if(a(this[b]))return this[b];return null},select:function(a){for(var b=[],d=0;d=0||(this.push(a),0))},addRange:function(a){return!!c.isArray(a)&&(this.push.apply(this,a),!0)},insert:function(a,b){return b=parseInt(b),!(!isNaN(b)&&(b<0||b>this.length)||(this.splice(b,0,a),0))},remove:function(a){var b=this.indexOf(a);return!(b<0||(this.splice(b,1),0))},removeAll:function(a){for(var b=!1;this.remove(a);)b=!0;return b},clear:function(){return this.splice(0,this.length),!0},removeWhere:function(a){for(var b=[],c=!1,d=0;d=1&&(b=arguments[0]),null==(a="string"==typeof b?this.create.apply(this,arguments):b)?null:this.addObject(a)?(this.triggerAdded(a),a):null},addObject:function(a){return!(null==a||!a instanceof this.type())&&((void 0===a.name||null==this.getByName(a.name()))&&(this.push(a),a))},create:function(){return null},remove:function(a){var b=this.getByName(a);return null!=b&&(!!this.base_remove(b)&&(this.triggerRemoved(b),!0))},wrap:function(a){var b=[a];return(null==a||!a instanceof this.type())&&(b=[]),new c.Collection(b)},onAdded:function(a){this.getset("addedFunc",a)},onRemoved:function(a){this.getset("removedFunc",a)},triggerAdded:function(a){var b=this.getset("addedFunc");b&&b(a)},triggerRemoved:function(a){var b=this.getset("removedFunc");b&&b(a)}},!0),c.extend(c.Collection,c.ObjectPrototype),c.Communicator=function(){this.__type="Svidget.Communicator",this.sameDomain=null,this._init()},c.Communicator.prototype={_init:function(){this.addMessageEvent()},addMessageEvent:function(){d.addEventListener&&d.addEventListener("message",c.wrap(this.receiveXSM,this),!1)},receiveFromParent:function(a,b){svidget.receiveFromParent(a,b)},receiveFromWidget:function(a,b,c){svidget.receiveFromWidget(a,b,c)},receiveXSM:function(a){if(null!=a){var b=a.data;null!=b&&(void 0!==b.widget?this.receiveFromWidget(b.name,b.payload,b.widget):this.receiveFromParent(b.name,b.payload))}},signalParent:function(a,b,c){this.isParentSameDomain()?this.signalParentDirect(a,b,c):this.signalParentXSM(a,b,c)},signalParentDirect:function(a,b,c){if(null!=d.parent&&d!==d.parent&&null!=d.parent.svidget&&d.parent.svidget){var e=d.parent.svidget;setTimeout(function(){e.routeFromWidget(a,b,c)},0)}},signalParentXSM:function(a,b,c){if(null!=d.parent&&null!=d.parent.postMessage){var e=this.buildSignalParentMessage(a,b,c);d.parent.postMessage(e,"*")}},buildSignalParentMessage:function(a,b,c){return{name:a,payload:b,widget:c}},isParentSameDomain:function(){return null==this.sameParentDomain&&(this.sameParentDomain=this.checkParentSameDomain()),this.sameParentDomain},checkParentSameDomain:function(){if(null==d.parent)return!1;try{d.parent.document;return!0}catch(a){return!1}},signalWidget:function(a,b,d){c.log("communicator: signalWidget {name: "+b+"}"),a.isCrossDomain()?this.signalWidgetXSM(a,b,d):this.signalWidgetDirect(a,b,d)},signalWidgetDirect:function(a,b,c){if(null!=a){var d=a.root();null!=d&&setTimeout(function(){d.receiveFromParent(b,c)},0)}},signalWidgetXSM:function(a,b,d){if(null!=a&&null!=a.window()){var e=this.buildSignalWidgetMessage(b,d);setTimeout(function(){c.log("communicator: postMessage"),a.window().postMessage(e,"*")},0)}},buildSignalWidgetMessage:function(a,b){return{name:a,payload:b}}},c.Conversion={},c.Conversion.to=function(a,b,d,e){var f=c.ParamTypes[b]||c.ParamTypes.object,g=c.ParamSubTypes[d]||c.ParamSubTypes.none;switch(f){case c.ParamTypes.string:return c.Conversion.toString(a,g,e);case c.ParamTypes.number:return c.Conversion.toNumber(a,g==c.ParamSubTypes.integer);case c.ParamTypes.bool:return c.Conversion.toBool(a);case c.ParamTypes.array:return c.Conversion.toArray(a);default:return c.Conversion.toObject(a)}},c.Conversion.toString=function(a,b,d){return null==a?null:b==c.ParamSubTypes.choice?c.Conversion.toChoiceString(a,d):c.isArray(a)||"object"==typeof a?JSON.stringify(a):a+""},c.Conversion.toChoiceString=function(a,b){if(a+="",null==b)return a;var c=b.split("|");return null==c||0==c.length?null:c.indexOf(a)>=0?a:c[0]},c.Conversion.toNumber=function(a,b){return a?!0===a?1:b?parseInt(a+""):(a=parseFloat(a),isNaN(a)&&(a=0),a):0},c.Conversion.toBool=function(a){return"false"!=(a+"").toLowerCase()&&0!=+a&&!!a},c.Conversion.toArray=function(a){if(null==a)return a;if(c.isArray(a))return a;if(c.Conversion.isArrayString(a)){var b=c.Conversion.parseArray(a);if(null!=b)return b}return[a]},c.Conversion.toObject=function(a){if(null==a)return a;if(c.Conversion.isJSONString(a)){var b=c.Conversion.jsonifyString(a);try{return JSON.parse(b)}catch(a){}}return a},c.Conversion.isJSONString=function(a){return!!a&&(a=(a+"").trim(),a.length>0&&c.isString(a)&&"{"==a.charAt(0)&&"}"==a.charAt(a.length-1))},c.Conversion.isArrayString=function(a){return null!=a&&(a=(a+"").trim(),a.length>0&&"["==a.charAt(0)&&"]"==a.charAt(a.length-1))},c.Conversion.isQuotedString=function(a){return!!a&&(a=(a+"").trim(),a.length>0&&c.isString(a)&&("'"==a.charAt(0)&&"'"==a.charAt(a.length-1)||'"'==a.charAt(0)&&'"'==a.charAt(a.length-1)))},c.Conversion.parseArray=function(a){a=c.Conversion.jsonifyString(a);var b='{"d":'+a+"}";try{var d=JSON.parse(b);return d&&d.d?d.d:null}catch(a){return null}},c.Conversion.jsonifyString=function(a){if(null==a||a.indexOf("'")<0)return a;a=(a+"").trim();for(var b="'",c='"',d="\\",e="",f=!1,g=null,h=!1,i=0;i0},hasAttributes:function(){if(this.isAttribute())return!1;var a=this.source();return!!(this.isAttached()||a.attributes&&a.attributes.length)&&a.attributes.length>0},isAttribute:function(){return this.type()==c.NodeType.attribute},elements:function(){if(null!=this.cachedElements&&c.isArray(this.cachedElements))return this.cachedElements;var a=this.isAttached(),b=this.source();if(!(a||b.elements&&b.elements.length))return null;var d=a?b.children:b.elements,e=new c.Collection(c.array(d));return e=e.select(function(a){return new c.DOMItem(a)}),this.cachedElements=e,this.cachedElements},attributes:function(){if(null!=this.cachedAttributes&&c.isArray(this.cachedAttributes))return this.cachedAttributes;var a=this.isAttached(),b=this.source();if(!(a||b.attributes&&b.attributes.length))return null;var d=b.attributes,e=new c.Collection(c.array(d));return e=e.select(function(a){return new c.DOMItem(a)}),this.cachedAttributes=e,this.cachedAttributes},source:function(){return this.getset("source")},isAttached:function(){return this.getset("sourceDOM")}},c.extend(c.DOMItem,c.ObjectPrototype),c.DOMQuery=function(a,b){this.__type="Svidget.DOMQuery";var d=new c.Collection(a),e=new function(){this.writable=[],this.items=d,this.selector=b};this.getPrivate=c.getPrivateAccessor(e),this.setPrivate=c.setPrivateAccessor(e),Object.defineProperty(this,"length",{enumerable:!0,configurable:!1,writable:!1,value:d.length||0})},c.DOMQuery.prototype={items:function(){return this.getset("items")},item:function(a){var b=this.items();return null==b?null:b[a]},hasItems:function(){return this.length>0},selector:function(){return this.getset("selector")},setValue:function(a){this.items().each(function(b){b.value(a)})},toString:function(){return'[Svidget.DOMQuery { selector: "'+this.selector()+'", items: '+this.items().length+"}]"}},c.extend(c.DOMQuery,c.ObjectPrototype),c.DocType={html:0,svg:1},c.DocReadyState={loading:0,interactive:1,complete:2},c.ElementReadyState={uninitialized:0,loading:1,loaded:2,interactive:3,complete:4},c.ParamTypes={object:0,string:1,number:2,boolean:3,bool:3,array:4,function:5},c.ParamSubTypes={none:0,color:1,integer:2,regex:3,choice:4},c.NodeType={element:0,attribute:1},c.Namespaces={html:"http://www.w3.org/1999/xhtml",svidget:"http://www.svidget.org/svidget",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"},c.Event=function(a,b,d,e,f,g){Object.defineProperty(this,"currentTarget",c.readOnlyProperty(e)),Object.defineProperty(this,"data",c.fixedProperty(d)),Object.defineProperty(this,"name",c.fixedProperty(a)),Object.defineProperty(this,"timeStamp",c.readOnlyProperty(+new Date)),Object.defineProperty(this,"target",c.readOnlyProperty(null==f?e:f)),Object.defineProperty(this,"type",c.readOnlyProperty(b)),Object.defineProperty(this,"value",c.readOnlyProperty(g))},c.Event.prototype={isPropagationStopped:c.returnFalse,isImmediatePropagationStopped:c.returnFalse,stopPropagation:function(){this.isPropagationStopped=c.returnTrue},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue,this.stopPropagation()}},c.EventContainer=function(a,b){this.__type="Svidget.EventContainer",c.EventPrototype.apply(this,[a]),this.target=b},c.EventContainer.prototype=new c.EventPrototype,c.extend(c.EventContainer,{getTarget:function(){return this.target}},!0),c.Root=function(a,b){this.__type="Svidget.Root";var f=this;null!=a&&(d=a,e=a.document||{});var g=new function(){this.writable=["current","widgets","connected","loaded"],this.comm=new c.Communicator,this.eventContainer=new c.EventContainer(["loaded"],f),this.loaded=!1,this.current=null,this.connected=!1,this.widgets=null,this.options=b||{}};this.setup(g),this.isBrowser=!0,this.docType=null,this.setCurrent=function(a){g.current=a},this._init(),Object.defineProperty(this,"conversion",c.readOnlyProperty(c.Conversion)),Object.defineProperty(this,"Collection",c.readOnlyProperty(c.Collection)),Object.defineProperty(this,"dom",c.readOnlyProperty(c.DOM)),Object.defineProperty(this,"util",c.readOnlyProperty(c.Util)),c.root=this},c.Root.prototype={_init:function(){this._initEvents(),this._initPrototypes(),this.initInternal(),this._initReady()},_initEvents:function(){},_initPrototypes:function(){this.isWidget()?c.extend(c.Root,c.Root.WidgetPrototype,!0):c.extend(c.Root,c.Root.PagePrototype,!0)},_initReady:function(){this.isDomReady()?this._ready():this.addReadyEvents()},initInternal:function(){},_ready:function(){this.isReady=!0,this.isWidget()?this.readyWidget():this.readyPage()},getDocType:function(){if(!e.documentElement)return c.DocType.html;var a=e.documentElement.localName,b=e.documentElement.namespaceURI;return"svg"==a&&b==c.Namespaces.svg?c.DocType.svg:c.DocType.html},getOption:function(a){return this.options()[a]},isWidget:function(){return this.getOption("mode")==c.DocType.svg||(this.docType=this.getDocType(),this.docType==c.DocType.svg)},isDomReady:function(){var a=e.readyState;return!(null==a||!c.DocReadyState[a])&&c.DocReadyState[a]>=c.DocReadyState.interactive},addReadyEvents:function(){var a=c.wrap(this.readyHandler,this);c.DOM.on(e,"DOMContentLoaded",a),c.DOM.on(e,"readystatechange",a),c.DOM.on(d,"load",a)},readyHandler:function(){this.ensureReady()},ensureReady:function(){this.isReady||this._ready(),this.isReady=!0},markLoaded:function(){!0!==this.getset("loaded")&&(this.getset("loaded",!0),this.triggerLoad())},eventContainer:function(){return this.getset("eventContainer")},on:function(a,b,c,d){this.eventContainer().on(a,b,c,d)},off:function(a,b){this.eventContainer().off(a,b)},trigger:function(a,b){this.eventContainer().trigger(a,b)},loaded:function(a,b,c){this.onload(a,b,c)},onload:function(a,b,c){this.on("load",a,b,c)},offload:function(a){this.off("load",a)},offdeclaredload:function(){this.off("load",c.declaredHandlerName)},widgetloaded:function(a,b,c){this.widgetloaded(a,b,c)},onwidgetload:function(a,b,c){this.on("widgetload",a,b,c)},offwidgetload:function(a){this.off("widgetload",a)},offdeclaredwidgetload:function(){this.off("widgetload",c.declaredHandlerName)},triggerLoad:function(){this.trigger("load")},triggerWidgetLoad:function(a){this.trigger("widgetload",a)},comm:function(){return this.getset("comm")},routeFromParent:function(a,b){c.log("root: routeFromParent {name: "+a+"}"),this.comm().receiveFromParent(a,b)},routeFromWidget:function(a,b,d){c.log("root: routeFromWidget {name: "+a+"}"),this.comm().receiveFromWidget(a,b,d)},receiveFromParent:function(a,b){},receiveFromWidget:function(a,b,c){},current:function(){return null},connected:function(a){var b=this.getset("connected",a);return!(void 0===a||!b)||b},options:function(){return this.getset("options")}},c.extend(c.Root,c.ObjectPrototype),c.Util={},c.Util.queryString=function(a,b){var e={};if(!d.location)return e;for(var f,g=null==d.location.search||d.location.search.length>0?d.location.search:"",h=/\+/g,i=/([^&=]+)=?([^&]*)/g,j=function(a){return decodeURIComponent(a.replace(h," "))},k=g.substring(1);f=i.exec(k);){var l=j(f[1]),m=j(f[2]);a?void 0!==e[l]?c.isArray(e[l])?e[l].push(m):e[l]=[e[l],m]:e[l]=m:(b||void 0===e[l])&&(e[l]=m)}return e},c.Action=function(a,b,d){function e(a){return null==a?null:("function"!=typeof a&&(a=h.toString(a)),a)}function f(a){if(null!=a&&c.isArray(a))for(var b=0;b0&&(this[n]=g(n))}},c.Proxy.prototype={parent:function(){return this.getPrivate("parent")},attached:function(){return null!=this.parent()},propertyChangeFuncs:function(){return this.getPrivate("propertyChangeFuncs")},connected:function(a){return this.getPrivate("connected")},getsetProp:function(a,b){var c=this.getset(a,b);return void 0!==b&&c?(this.handlePropertyChange(a,b),!0):c},handlePropertyChange:function(a,b){},triggerPropertyChange:function(a,b){var c=this;this.propertyChangeFuncs().each(function(d){d(c,a,b)})},notifyPropertyChange:function(a,b){null!=a&&(this.getset(a,b),this.triggerFromWidget("change",{property:a,value:b},this))},refreshProperties:function(a){for(var b in a){null!=this.getPrivate(b)&&this.setPrivate(b,a[b])}},connect:function(){this.setPrivate("connected",!0)},onPropertyChange:function(a){return this.propertyChangeFuncs().add(a),!0},offPropertyChange:function(a){return this.propertyChangeFuncs().remove(a)},eventContainer:function(){return this.getPrivate("eventContainer")},on:function(a,b,c,d){this.eventContainer().on(a,b,c,d)},off:function(a,b){this.eventContainer().off(a,b)},triggerFromWidget:function(a,b,c){this.eventContainer().trigger(a,b,c)},registerBubbleCallback:function(a,b,c){this.eventContainer().registerBubbleCallback(a,b,c)}},c.extend(c.Proxy,c.ObjectPrototype),c.ActionProxy=function(a,b,d){var e=this,f={name:a,params:new c.ActionParamProxyCollection([],e)};b=b||{};for(var g in b)void 0===f[g]&&(f[g]=b[g]);d&&(d=d instanceof c.WidgetReference?d:null),c.Proxy.apply(this,[d,f,c.Action.allProxyProperties,c.Action.writableProxyProperties]),this.__type="Svidget.ActionProxy",this.registerBubbleCallback(c.Action.eventTypes,d,d.actionProxyBubble),this.wireCollectionAddRemoveHandlers(f.params,e.paramAdded,e.paramRemoved)},c.ActionProxy.prototype=new c.Proxy,c.extend(c.ActionProxy,{invoke:function(){if(!this.canInvoke())return!1;var a=c.array(arguments);return svidget.signalActionInvoke(this.parent(),this,a),!0},canInvoke:function(){return this.getset("external")},invokeFromWidget:function(a){this.triggerFromWidget("invoke",{returnValue:a},this)},params:function(a){var b=this.getset("params");return this.select(b,a)},param:function(a){var b=this.getset("params");return this.selectFirst(b,a)},addParam:function(a,b){return this.params().add(a,b,this)},removeParam:function(a){return this.params().remove(a)},paramProxyBubble:function(a,b,c){"change"==a&&this.paramChanged(c,b.value)},paramChanged:function(a,b){this.triggerFromWidget("paramchange",b,a)},paramAdded:function(a){this.triggerFromWidget("paramadd",a)},paramRemoved:function(a){this.triggerFromWidget("paramremove",a.name())},onchange:function(a,b,c){return this.on("change",a,b,c)},offchange:function(a){this.off("change",a)},oninvoke:function(a,b,c){return this.on("invoke",a,b,c)},offinvoke:function(a){return this.off("invoke",a)},onparamadd:function(a,b,c){return this.on("paramadd",a,b,c)},offparamadd:function(a){return this.off("paramadd",a)},onparamchange:function(a,b,c){return this.on("paramchange",a,b,c)},offparamchange:function(a){return this.off("paramchange",a)},onparamremove:function(a,b,c){return this.on("paramremove",a,b,c)},offparamremove:function(a){return this.off("paramremove",a)},toString:function(){return'[Svidget.ActionProxy { name: "'+this.name+'" }]'}},!0),c.ActionProxyCollection=function(a,b){c.ObjectCollection.apply(this,[a,c.ActionProxy]),this.__type="Svidget.ActionProxyCollection";this.parent=b,this._ctor=c.ActionProxyCollection},c.ActionProxyCollection.prototype=new c.ObjectCollection,c.extend(c.ActionProxyCollection,{create:function(a,b,d){return null==a?null:null!=this.getByName(a)?null:new c.ActionProxy(a,b,d)}},!0),c.ActionParamProxy=function(a,b,d){var e={name:a};b=b||{};for(var f in b)void 0===e[f]&&(e[f]=b[f]);d&&(d=d instanceof c.ActionProxy?d:null),c.Proxy.apply(this,[d,e,c.ActionParam.allProxyProperties,c.ActionParam.writableProxyProperties]),this.__type="Svidget.ActionParamProxy",this.registerBubbleCallback(c.ActionParam.eventTypes,d,d.paramProxyBubble)},c.ActionParamProxy.prototype=new c.Proxy,c.extend(c.ActionParamProxy,{toString:function(){return'[Svidget.ActionParamProxy { name: "'+this.name()+'" }]'}},!0),c.ActionParamProxyCollection=function(a,b){c.ObjectCollection.apply(this,[a,c.ActionParamProxy]),this.__type="Svidget.ActionParamProxyCollection";this.parent=b,this._ctor=c.ActionParamProxyCollection},c.ActionParamProxyCollection.prototype=new c.ObjectCollection,c.extend(c.ActionParamProxyCollection,{create:function(a,b,d){return null==a?null:null!=this.getByName(a)?null:new c.ActionParamProxy(a,b,d)}},!0),c.EventDescProxy=function(a,b,d){var e="trigger",f={name:a,eventName:e};b=b||{};for(var g in b)void 0===f[g]&&(f[g]=b[g]);d&&(d=d instanceof c.WidgetReference?d:null),c.Proxy.apply(this,[d,f,c.EventDesc.allProxyProperties,c.EventDesc.writableProxyProperties]),this.__type="Svidget.EventDescProxy",this.registerBubbleCallback(c.EventDesc.eventTypes,d,d.eventProxyBubble)},c.EventDescProxy.prototype=new c.Proxy,c.extend(c.EventDescProxy,{triggerEventName:function(){return this.getPrivate("eventName")},on:function(a,b,d,e){c.isFunction(a)&&(e=a,a=this.triggerEventName()),this.eventContainer().on(a,b,d,e)},ontrigger:function(a,b,c){this.eventContainer().on(this.triggerEventName(),a,b,c)},off:function(a,b){c.isFunction(a)&&(b=a,a=this.triggerEventName()),this.eventContainer().off(a,b)},offtrigger:function(a){this.eventContainer().off(this.triggerEventName(),a)},onchange:function(a,b,c){return this.on("change",a,b,c)},offchange:function(a){this.off("change",a)},trigger:function(a){return!!this.canTrigger()&&(svidget.signalEventTrigger(this.parent(),this,a),!0)},canTrigger:function(){return this.getset("external")},triggerEventFromWidget:function(a){this.eventContainer().trigger(this.triggerEventName(),a)},toString:function(){return'[Svidget.EventDescProxy { name: "'+this.name+'" }]'}},!0),c.EventDescProxyCollection=function(a,b){c.ObjectCollection.apply(this,[a,c.EventDescProxy]),this.__type="Svidget.EventDescProxyCollection";this.parent=b,this._ctor=c.EventDescProxyCollection},c.EventDescProxyCollection.prototype=new c.ObjectCollection,c.extend(c.EventDescProxyCollection,{create:function(a,b,d){return null==a?null:null!=this.getByName(a)?null:new c.EventDescProxy(a,b,d)}},!0),c.ParamProxy=function(a,b,d,e){var f={name:a,value:b};d=d||{};for(var g in d)f[g]=d[g];e&&(e=e instanceof c.WidgetReference?e:null),c.Proxy.apply(this,[e,f,c.Param.allProxyProperties,c.Param.writableProxyProperties]),this.__type="Svidget.ParamProxy",this.registerBubbleCallback(c.Param.eventTypes,e,e.paramProxyBubble)},c.ParamProxy.prototype=new c.Proxy,c.extend(c.ParamProxy,{handlePropertyChange:function(a,b){"value"==a&&(this.parent().updateParamValue(this.name(),b),svidget.signalPropertyChange(this.parent(),this,"param",a,b))},notifyValueChange:function(a){this.getset("value",a),this.triggerFromWidget("valuechange",{value:a},this),this.triggerFromWidget("set",{value:a},this)},serializedValue:function(){var a=this.value();return c.Conversion.toString(a)},onchange:function(a,b,c){return this.on("change",a,b,c)},offchange:function(a){this.off("change",a)},onset:function(a,b,c){return this.on("set",a,b,c)},offset:function(a){return this.off("set",a)},toString:function(){return'[Svidget.ParamProxy { name: "'+this.name+'" }]'}},!0),c.ParamProxyCollection=function(a,b){c.ObjectCollection.apply(this,[a,c.ParamProxy]),this.__type="Svidget.ParamProxyCollection";this.parent=b,this._ctor=c.ParamProxyCollection},c.ParamProxyCollection.prototype=new c.ObjectCollection,c.extend(c.ParamProxyCollection,{create:function(a,b,d,e){return null==a?null:null!=this.getByName(a)?null:new c.ParamProxy(a,b,d,e)}},!0),c.WidgetReference=function(a,b,d,e,f,g){function h(a){if(null!=a)for(var b in a)this.addParamProxy(b,a[b],{connected:!1})}this.__type="Svidget.WidgetReference";var i=this,j=new function(){this.writable=["enabled","started","populated","paramValues"],this.params=new c.ParamProxyCollection([],i),this.actions=new c.ActionProxyCollection([],i),this.events=new c.EventDescProxyCollection([],i),this.eventContainer=new c.EventContainer(c.Widget.eventTypes,i),this.paramValues=b,this.enabled=!0,this.started=!1,this.populated=!1,this.connected=!!f,this.crossdomain=!!g,this.state="declared",this.id=a,this.element=e,this.declaringElement=d,this.url=d.getAttribute("data")};this.setup(j),this.setElement=function(a){return null==j.element&&(!!c.DOM.isElement(a)&&(j.element=a,void(this.setElement=null)))},h.call(i,b),d.widgetReference=this,this.wireCollectionAddRemoveHandlers(j.params,i.paramProxyAdded,i.paramProxyRemoved),this.wireCollectionAddRemoveHandlers(j.actions,i.actionProxyAdded,i.actionProxyRemoved),this.wireCollectionAddRemoveHandlers(j.events,i.eventProxyAdded,i.eventProxyRemoved)},c.WidgetReference.prototype={id:function(){return this.getset("id")},name:function(){return this.id()},enabled:function(){return this.getset("enabled")},url:function(){return this.getset("url")},element:function(){return this.getset("element")},declaringElement:function(){return this.getset("declaringElement")},root:function(){if(this.isCrossDomain())return null;var a=this.document();return(a.parentWindow||a.defaultView).svidget},window:function(){var a=this.element();return null==a?null:a.contentWindow},document:function(){var a=this.element();return c.DOM.getDocument(a)},connected:function(a){var b=this.getset("connected",a);return!(void 0===a||!b)||b},crossdomain:function(a){var b=this.getset("crossdomain",a);return!(void 0===a||!b)||b},params:function(a){var b=this.getset("params");return this.select(b,a)},param:function(a){var b=this.getset("params");return this.selectFirst(b,a)},actions:function(a){var b=this.getset("actions");return this.select(b,a)},action:function(a){var b=this.getset("actions");return this.selectFirst(b,a)},events:function(a){var b=this.getset("events");return this.select(b,a)},event:function(a){var b=this.getset("events");return this.selectFirst(b,a)},paramValues:function(){return this.getset("paramValues")},addParamProxy:function(a,b,c){return this.params().add(a,b,c,this)},removeParamProxy:function(a){return this.params().remove(a)},refreshParamProxy:function(a,b,c){var d=this.param(a);return null==d?this.params().add(a,b,c,this):(d.refreshProperties(c),d)},updateParamValue:function(a,b){var c=this.getset("paramValues");c=c||{},c[a]=b,this.getset("paramValues",c)},paramProxyAdded:function(a){c.log("page: param proxy added: "+a.name()),this.triggerFromWidget("paramadd",a)},paramProxyRemoved:function(a){c.log("page: param proxy removed: "+a.name()),this.triggerFromWidget("paramremove",a.name())},paramProxyBubble:function(a,b,d){c.log("page: param proxy bubble: "+d.name()),"change"==a&&this.paramProxyChanged(d,b.value),"valuechange"==a&&this.paramProxyValueChanged(d,b.value)},paramProxyChanged:function(a,b){c.log("page: param proxy change: "+a.name()),this.triggerFromWidget("paramchange",b,a)},paramProxyValueChanged:function(a,b){c.log("page: param proxy value change: "+a.name()),this.triggerFromWidget("paramvaluechange",b,a)},addActionProxy:function(a,b){return this.actions().add(a,b,this)},removeActionProxy:function(a){return this.actions().remove(a)},actionProxyAdded:function(a){c.log("page: action proxy added: "+a.name()),this.triggerFromWidget("actionadd",a)},actionProxyRemoved:function(a){c.log("page: action proxy removed: "+a.name()),this.triggerFromWidget("actionremove",a.name())},actionProxyBubble:function(a,b,d){c.log("page: action proxy bubble: "+d.name()),"invoke"==a&&this.actionProxyInvoked(d,b.value),"change"==a&&this.actionProxyChanged(d,b.value),"paramchange"==a&&this.actionParamProxyChanged(d,b.target,b.value),"paramadd"==a&&this.actionParamProxyAdded(d,b.value),"paramremove"==a&&this.actionParamProxyRemoved(d,b.value)},actionProxyInvoked:function(a,b){this.triggerFromWidget("actioninvoke",b,a)},actionProxyChanged:function(a,b){this.triggerFromWidget("actionchange",b,a)},actionParamProxyAdded:function(a,b){this.triggerFromWidget("actionparamadd",b,a)},actionParamProxyRemoved:function(a,b){this.triggerFromWidget("actionparamremove",b,a)},actionParamProxyChanged:function(a,b,c){this.triggerFromWidget("actionparamchange",c,b)},addEventProxy:function(a,b){return this.events().add(a,b,this)},removeEventProxy:function(a){return this.events().remove(a)},eventProxyAdded:function(a){c.log("page: event proxy added: "+a.name()),this.triggerFromWidget("eventadd",a)},eventProxyRemoved:function(a){ c.log("page: event proxy removed: "+a.name()),this.triggerFromWidget("eventremove",a.name())},eventProxyBubble:function(a,b,d){c.log("page: event proxy bubble: "+d.name()),"trigger"==a&&this.eventProxyTriggered(d,b),"change"==a&&this.eventProxyChanged(d,b.value)},eventProxyTriggered:function(a,b){c.log("page: event proxy trigger: "+a.name()),this.triggerFromWidget("eventtrigger",b.value,a)},eventProxyChanged:function(a,b){c.log("page: event proxy change: "+a.name()),this.triggerFromWidget("eventchange",b,a)},eventContainer:function(){return this.getPrivate("eventContainer")},on:function(a,b,c,d){this.eventContainer().on(a,b,c,d)},off:function(a,b){this.eventContainer().off(a,b)},triggerFromWidget:function(a,b,c){this.eventContainer().trigger(a,b,c)},hasElement:function(){return null!=this.element()},isAttached:function(){var a=this.element();return null!=a&&null!=a.parentNode},isCrossDomain:function(){return this.element()!==this.declaringElement()},started:function(){return this.getset("started")},populated:function(){return this.getset("populated")},start:function(){this.getset("started",!0)},populate:function(a){this.populated()||(this.enabled(a.enabled),this._populateParams(a.params),this._populateActions(a.actions),this._populateEvents(a.events),this.getset("populated",!0))},_populateParams:function(a){if(a&&c.isArray(a))for(var b=0;b0&&(d[f]=b[e].getAttribute("value"))}return d},getWidget:function(a){return null==a?null:this.widgets().first(function(b){return b.id()===a})},addWidget:function(a){return!this.widgets().contains(a)&&(this.widgets().add(a),!0)},load:function(a,b,d,e){var f=c.DOM.selectElement(a);if(null==f)return null;var g=null;if("string"==typeof b)g={url:b};else{if(null==b)return null;g=b}if(null!=g.url){this.allWidgetsStarted=!1;var h=this.createObjectElement(f,g,d);delete h.svidgetLoad;var i=this.loadPageWidget(h,d);return e&&"function"==typeof e&&setTimeout(function(){e(i)},0),i}},widgets:function(a){var b=this.getWidgets();return this.select(b,a)},widget:function(a){var b=this.getWidgets();return this.selectFirst(b,a)},getWidgets:function(){var a=this.getset("widgets");return null==a&&(a=new c.ObjectCollection(null,c.WidgetReference),this.getset("widgets",a)),a},triggerWidgetEvent:function(a,b,c){var d=a.event(b);null!=d&&d.triggerFromWidget(c)},receiveFromWidget:function(a,b,d){c.log("page: receiveFromWidget {name: "+a+", widgetID: "+d+"}");var e=this.getWidget(d);switch(a){case"paramadded":this.handleReceiveWidgetParamAdded(e,b);break;case"paramremoved":this.handleReceiveWidgetParamRemoved(e,b);break;case"paramchanged":this.handleReceiveWidgetParamChanged(e,b);break;case"paramset":this.handleReceiveWidgetParamSet(e,b);break;case"actionadded":this.handleReceiveWidgetActionAdded(e,b);break;case"actionremoved":this.handleReceiveWidgetActionRemoved(e,b);break;case"actionchanged":this.handleReceiveWidgetActionChanged(e,b);break;case"actioninvoked":this.handleReceiveWidgetActionInvoked(e,b);break;case"actionparamadded":this.handleReceiveWidgetActionParamAdded(e,b);break;case"actionparamremoved":this.handleReceiveWidgetActionParamRemoved(e,b);break;case"actionparamchanged":this.handleReceiveWidgetActionParamChanged(e,b);break;case"eventadded":this.handleReceiveWidgetEventAdded(e,b);break;case"eventremoved":this.handleReceiveWidgetEventRemoved(e,b);break;case"eventchanged":this.handleReceiveWidgetEventChanged(e,b);break;case"eventtriggered":this.handleReceiveWidgetEventTriggered(e,b);break;case"startack":this.handleReceiveWidgetStartAck(e,b)}},signalStart:function(a,b){c.log("page: signalStart {id: "+a.id()+", url: "+a.url()+", tag: "+a.element().tagName+"}");var d={id:a.id(),params:b,connected:a.connected()};this.comm().signalWidget(a,"start",d)},signalPropertyChange:function(a,b,d,e,f){if(a.started()&&a.connected()){c.log("page: signalPropertyChange {id: "+a.id()+", type: "+d+"}");var g={type:d,name:b.name(),propertyName:e,value:f};this.comm().signalWidget(a,"propertychange",g)}},signalActionInvoke:function(a,b,d){if(a.started()&&a.connected()){c.log("page: signalActionInvoke {id: "+a.id()+", url: "+a.url()+"}");var e={action:b.name(),args:d};this.comm().signalWidget(a,"actioninvoke",e)}},signalEventTrigger:function(a,b,d){if(a.started()&&a.connected()){c.log("page: signalEventTrigger {id: "+a.id()+"}");var e={event:b.name(),data:d};this.comm().signalWidget(a,"eventtrigger",e)}},handleReceiveWidgetInitialized:function(){c.log("page: handleReceiveWidgetInitialized")},handleReceiveWidgetLoaded:function(a,b){if(null==a)return void this.checkUnfinishedWidgetReferences();this.populateWidgetReference(a,b)},handleReceiveWidgetStartAck:function(a,b){c.log("page: handleReceiveWidgetStartAck {widget: "+a.id()+"}"),a.started()||(a.start(),this.populateWidgetReference(a,b),this.triggerWidgetLoad(a.id()),this.areAllWidgetsStarted()&&(this.allWidgetsStarted=!0,this.markLoaded()))},handleReceiveWidgetParamAdded:function(a,b){c.log("page: handleReceiveWidgetParamAdded {param: "+b.name+"}"),a.addParamProxy(b.name,b)},handleReceiveWidgetParamRemoved:function(a,b){c.log("page: handleReceiveWidgetParamRemoved {param: "+b+"}"),a.removeParamProxy(b)},handleReceiveWidgetParamChanged:function(a,b){c.log("page: handleReceiveWidgetParamChanged {param: "+b.name+"}");var d=a.param(b.name);null!=d&&d.notifyPropertyChange(b.property,b.value)},handleReceiveWidgetParamSet:function(a,b){c.log("page: handleReceiveWidgetParamSet {param: "+b.name+"}");var d=a.param(b.name);null!=d&&d.notifyValueChange(b.value)},handleReceiveWidgetActionAdded:function(a,b){c.log("page: handleReceiveWidgetActionAdded {action: "+b.name+"}"),a.addActionProxy(b.name,b)},handleReceiveWidgetActionRemoved:function(a,b){c.log("page: handleReceiveWidgetActionRemoved {action: "+b+"}"),a.removeActionProxy(b)},handleReceiveWidgetActionChanged:function(a,b){c.log("page: handleReceiveWidgetActionChanged {action: "+b.name+"}");var d=a.action(b.name);null!=d&&d.notifyPropertyChange(b.property,b.value)},handleReceiveWidgetActionInvoked:function(a,b){c.log("page: handleReceiveWidgetActionInvoked {action: "+b.name+"}");var d=a.action(b.name);null!=d&&d.invokeFromWidget(b.returnValue)},handleReceiveWidgetActionParamAdded:function(a,b){c.log("page: handleReceiveWidgetActionParamAdded {actionparam: "+b.name+"}");var d=a.action(b.actionName);null!=d&&d.addParam(b.name,b)},handleReceiveWidgetActionParamRemoved:function(a,b){c.log("page: handleReceiveWidgetActionParamRemoved {actionparam: "+b+"}");var d=a.action(b.actionName);null!=d&&d.removeParam(b.name)},handleReceiveWidgetActionParamChanged:function(a,b){c.log("page: handleReceiveWidgetActionParamChanged {actionparam: "+b.name+"}");var d=a.action(b.actionName);if(null!=d){var e=d.param(b.name);null!=e&&e.notifyPropertyChange(b.property,b.value)}},handleReceiveWidgetEventAdded:function(a,b){c.log("page: handleReceiveWidgetEventAdded {event: "+b.name+"}"),a.addEventProxy(b.name,b)},handleReceiveWidgetEventRemoved:function(a,b){c.log("page: handleReceiveWidgetEventRemoved {event: "+b+"}"),a.removeEventProxy(b)},handleReceiveWidgetEventChanged:function(a,b){c.log("page: handleReceiveWidgetEventChanged {event: "+b.name+"}");var d=a.event(b.name);null!=d&&d.notifyPropertyChange(b.property,b.value)},handleReceiveWidgetEventTriggered:function(a,b){c.log("page: handleReceiveWidgetEventTriggered {event: "+b.name+"}");var d=a.event(b.name);null!=d&&d.triggerEventFromWidget(b.value)}},c.Root.WidgetPrototype={initInternal:function(){this.loadCurrent(),d._svidget="widget"},readyWidget:function(){c.log("widget: readyWidget"),this.startWidget(),this.markLoaded()},loadCurrent:function(){var a=new c.Widget;this.setCurrent(a),this.setCurrent=null,Object.defineProperty(this,"$",c.readOnlyProperty(a))},startWidget:function(){var a=this.current();this.parseElements(),this.connected()?this.startWidgetConnected(a):this.startWidgetStandalone(a)},startWidgetStandalone:function(a){var b=this.getParamValuesFromQueryString();this.setParamValues(a,b,!0),a.start()},startWidgetConnected:function(a){null!=this.paramValues&&(this.setParamValues(this.paramValues),this.paramValues=null,a.setPopulatedFromPage()),a.start()},parseElements:function(){var a=this.getParamsElement();this.populateParams(a);var b=this.getActionsElement();this.populateActions(b);var c=this.getEventsElement();this.populateEvents(c)},getParamsElement:function(){return this.getSvidgetElement("params")},getActionsElement:function(){return this.getSvidgetElement("actions")},getEventsElement:function(){return this.getSvidgetElement("events")},getSvidgetElement:function(a){var b=c.DOM.getByNameSvidget(a,!0);return 0==b.length?null:b[0]},populateParams:function(a){if(null!=a){var b=this,d=this.current();this.populateElementObjects(a,function(a,c){var d=b.buildParam(a,c);null!=d&&c.addParam(d)}),this.wireDeclaredHandler(d,d.ondeclaredparamadd,c.DOM.attrValue(a,"onadd")),this.wireDeclaredHandler(d,d.ondeclaredparamremove,c.DOM.attrValue(a,"onremove"))}},buildParam:function(a,b){if(!this.isValidSvidgetElement(a,"param"))return null;var d=c.DOM.attrValue(a,"name");if(null==d)return null;var e=c.DOM.attrValue(a,"value"),f=this.buildOptions(a,c.Param.optionProperties),g=new c.Param(d,e,f,b);return this.wireDeclaredChangeHandler(g,c.DOM.attrValue(a,"onchange")),this.wireDeclaredSetHandler(g,c.DOM.attrValue(a,"onset")),g},populateActions:function(a){if(null!=a){var b=this,d=this.current();this.populateElementObjects(a,function(a,c){var d=b.buildAction(a,c);null!=d&&(c.addAction(d),b.populateActionParams(a,d))}),this.wireDeclaredHandler(d,d.ondeclaredactionadd,c.DOM.attrValue(a,"onadd")),this.wireDeclaredHandler(d,d.ondeclaredactionremove,c.DOM.attrValue(a,"onremove"))}},populateActionParams:function(a,b){if(null!=a){var c=this;this.populateElementObjects(a,function(a,d){var e=c.buildActionParam(a,b);null!=e&&b.addParam(e)})}},buildAction:function(a,b){if(!this.isValidSvidgetElement(a,"action"))return null;var d=c.DOM.attrValue(a,"name");if(null==d)return null;var e=this.buildOptions(a,c.Action.optionProperties),f=new c.Action(d,e,b);return this.wireDeclaredChangeHandler(f,c.DOM.attrValue(a,"onchange")),this.wireDeclaredInvokeHandler(f,c.DOM.attrValue(a,"oninvoke")),this.wireDeclaredParamAddHandler(f,c.DOM.attrValue(a,"onparamadd")),this.wireDeclaredParamRemoveHandler(f,c.DOM.attrValue(a,"onparamremove")),this.wireDeclaredParamChangeHandler(f,c.DOM.attrValue(a,"onparamchange")),f},buildActionParam:function(a,b){if(!this.isValidSvidgetElement(a,"actionparam"))return null;var d=c.DOM.attrValue(a,"name");if(null==d)return null;var e=this.buildOptions(a,c.ActionParam.optionProperties),f=new c.ActionParam(d,e,b);return this.wireDeclaredChangeHandler(f,c.DOM.attrValue(a,"onchange")),f},populateEvents:function(a){if(null!=a){var b=this,d=this.current();this.populateElementObjects(a,function(a,c){var d=b.buildEvent(a,c);null!=d&&c.addEvent(d)}),this.wireDeclaredHandler(d,d.ondeclaredeventadd,c.DOM.attrValue(a,"onadd")),this.wireDeclaredHandler(d,d.ondeclaredeventremove,c.DOM.attrValue(a,"onremove"))}},buildEvent:function(a,b){if(!this.isValidSvidgetElement(a,"event"))return null;var d=c.DOM.attrValue(a,"name");if(null==d)return null;var e=this.buildOptions(a,c.EventDesc.optionProperties),f=new c.EventDesc(d,e,b);return this.wireDeclaredChangeHandler(f,c.DOM.attrValue(a,"onchange")),this.wireDeclaredTriggerHandler(f,c.DOM.attrValue(a,"ontrigger")),f},populateElementObjects:function(a,b){if(null!=a&&null!=a.childNodes)for(var c=this.current(),d=a.firstElementChild;null!=d;)b&&b(d,c),d=d.nextElementSibling},buildOptions:function(a,b){var d={};if(null==b||!c.isArray(b))return d;for(var e=0;e0&&a.viewBox.baseVal.height>0&&(a.setAttribute("width","100%"),a.setAttribute("height","100%"))},current:function(){return this.getset("current")},connected:function(){return this.getset("connected")},receiveFromParent:function(a,b){c.log("widget: receiveFromParent {name: "+a+"}"),"start"==a?this.handleReceiveParentStart(b):"actioninvoke"==a?this.handleReceiveParentActionInvoke(b):"eventtrigger"==a?this.handleReceiveParentEventTrigger(b):"propertychange"==a&&this.handleReceiveParentPropertyChange(b)},signalStartAck:function(){c.log("widget: signalStartAck {id: "+this.current().id()+"}");var a=this.current().toTransport();this.comm().signalParent("startack",a,this.current().id())},signalParamAdded:function(a){if(this.connected()){c.log("widget: signalParamAdded {id: "+this.current().id()+"}");var b=a.toTransport();this.comm().signalParent("paramadded",b,this.current().id())}},signalParamRemoved:function(a){this.connected()&&(c.log("widget: signalParamRemoved {id: "+this.current().id()+"}"),this.comm().signalParent("paramremoved",a,this.current().id()))},signalParamChanged:function(a,b){this.connected()&&(c.log("widget: signalParamChanged {id: "+this.current().id()+"}"),b.name=a.name(),this.comm().signalParent("paramchanged",b,this.current().id()))},signalParamSet:function(a,b){this.connected()&&(c.log("widget: signalParamSet {id: "+this.current().id()+"}"),b.name=a.name(),this.comm().signalParent("paramset",b,this.current().id()))},signalActionAdded:function(a){if(this.connected()){c.log("widget: signalActionAdded {id: "+this.current().id()+"}");var b=a.toTransport();this.comm().signalParent("actionadded",b,this.current().id())}},signalActionRemoved:function(a){this.connected()&&(c.log("widget: signalActionRemoved {id: "+this.current().id()+"}"),this.comm().signalParent("actionremoved",a,this.current().id()))},signalActionChanged:function(a,b){this.connected()&&(c.log("widget: signalActionChanged {id: "+this.current().id()+"}"),b.name=a.name(),this.comm().signalParent("actionchanged",b,this.current().id()))},signalActionInvoked:function(a,b){this.connected()&&(c.log("widget: signalActionInvoked {id: "+this.current().id()+"}"),b.name=a.name(),this.comm().signalParent("actioninvoked",b,this.current().id()))},signalActionParamAdded:function(a,b){if(this.connected()){c.log("widget: signalActionParamAdded {id: "+this.current().id()+"}");var d=a.toTransport();d.actionName=b,this.comm().signalParent("actionparamadded",d,this.current().id())}},signalActionParamRemoved:function(a,b){if(this.connected()){c.log("widget: signalActionParamRemoved {id: "+this.current().id()+"}");var d={name:a,actionName:b};this.comm().signalParent("actionparamremoved",d,this.current().id())}},signalActionParamChanged:function(a,b,d){this.connected()&&(c.log("widget: signalActionParamChanged {id: "+this.current().id()+"}"),d.name=a.name(),d.actionName=b.name(),this.comm().signalParent("actionparamchanged",d,this.current().id()))},signalEventAdded:function(a){if(this.connected()){c.log("widget: signalEventAdded {id: "+this.current().id()+"}");var b=a.toTransport();this.comm().signalParent("eventadded",b,this.current().id())}},signalEventRemoved:function(a){this.connected()&&(c.log("widget: signalEventRemoved {id: "+this.current().id()+"}"),this.comm().signalParent("eventremoved",a,this.current().id()))},signalEventChanged:function(a,b){this.connected()&&(c.log("widget: signalEventChanged {id: "+this.current().id()+"}"),b.name=a.name(),this.comm().signalParent("eventchanged",b,this.current().id()))},signalEventTriggered:function(a,b){if(this.connected()){c.log("widget: signalEventTriggered {id: "+this.current().id()+"}");var d={name:a.name(),value:b};this.comm().signalParent("eventtriggered",d,this.current().id())}},handleReceiveParentStart:function(a){a=a||{};var b=!1!==a.connected;this.connectWidget(a.id,a.params,b),b&&this.signalStartAck(),this.startWidgetWithPageParams()},handleReceiveParentPropertyChange:function(a){a=a||{};a.type;if("param"==a.type&&"value"==a.propertyName&&null!=a.name){var b=this.current().param(a.name);null!=b&&b.value(a.value)}},handleReceiveParentActionInvoke:function(a){a=a||{};var b=a.action,c=this.current().action(b);null!=c&&c.external()&&c.invokeApply(a.args)},handleReceiveParentEventTrigger:function(a){a=a||{};var b=a.event,c=this.current().event(b);null!=c&&c.external()&&c.trigger(a.data)}},d.document||console.warn("svidget requires a global windowy object with window.document to work correctly."),new c.Root(d,b)});