"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.safeAreaProps=exports.default=void 0;var _useNativeAPI=require("../hooks/useNativeAPI"),_useSafeArea=require("../hooks/useSafeArea");function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var safeAreaProps=exports.safeAreaProps={safeArea:{type:[Boolean,String,Object],optionalTypes:[Boolean,String,Object],value:!1},safeAreaStyle:{type:String,value:"default"}},getDefaultSafeArea=function(){return{top:!1,bottom:!1}},setSafeArea=function(e){return"boolean"==typeof e?Object.assign({},getDefaultSafeArea(),{top:e,bottom:e}):null!==e&&"object"===_typeof(e)?Object.assign({},getDefaultSafeArea(),e):"string"==typeof e?Object.assign({},getDefaultSafeArea(),_defineProperty({},e,!0)):getDefaultSafeArea()},_default=exports.default=Behavior({properties:_objectSpread({},safeAreaProps),data:{safeAreaConfig:getDefaultSafeArea(),isIPhoneX:!1},observers:{safeArea:function(e){this.setData({safeAreaConfig:setSafeArea(e)})}},definitionFilter:function(e){var t=(0,_useNativeAPI.getSystemInfoSync)(["window","device"]),t=(0,_useSafeArea.checkIPhoneX)(t);Object.assign(e.data=e.data||{},{safeAreaConfig:getDefaultSafeArea(),isIPhoneX:t})}});